package com.sky.mapper;

import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    List<Setmeal> getSetmealIdsByDishIds(List<Long> ids);


    void insertOnlySetmealDish(List<SetmealDish> dishes);

    // 添加 @Param 注解明确参数名
    void deleteSetmealDishByIds(@Param("setmealdishids") List<Long> setmealdishids);


    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteSetmealDishById(Long setmealId); // 参数名匹配

    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
